﻿
namespace SistemaLogistica.Business.Logic
{
    using System;
    using System.Collections.Generic;
    using SistemaLogistica.Business.Entities;
    using SistemaLogistica.DataAccess;

    public class UbigeoManager
    {
        private UbigeoManager() { }

        private static readonly UbigeoManager instancia = new UbigeoManager();

        public static UbigeoManager Instancia
        {
            get { return instancia; }
        }

        public List<Ubigeo> Listar()
        {
            try
            {
                return UbigeoData.Instancia.Listar();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Ubigeo> ListarDepartamentos()
        {
            try
            {
                return UbigeoData.Instancia.ListarDepartamentos();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Ubigeo> ListarProvincias(int departamentoID)
        {
            try
            {
                return UbigeoData.Instancia.ListarProvincias(departamentoID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public List<Ubigeo> ListarDistritos(int departamentoID, int provinciaID)
        {
            try
            {
                return UbigeoData.Instancia.ListarDistritos(departamentoID, provinciaID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public Ubigeo ObtenerPorID(int ubigeoID)
        {
            try
            {
                return UbigeoData.Instancia.ObtenerPorID(ubigeoID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public int ListarIDPorDPD(int departamentoID, int provinciaID, int distritoID)
        {
            try
            {
                return UbigeoData.Instancia.ListarIDPorDPD(departamentoID, provinciaID, distritoID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
